<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="yaodian100" uri="http://www.yaodian100.com/jsp/yaodian100" %>
<%@ include file="/taglibs.jsp"%>
<c-rt:set var="midContextPath" value='<%=ServerValue.getMidContextPath()%>'/>
<style type="text/css" media="screen">
 <!-- 
  SELECT.selCont{ margin: 10px; width: 300px; }
  select.selCont1{ margin: 10px; width: 960px; }
  -->
</style> 
<script type="text/javascript">
	// 评价标签 mouseover 效果
	jQuery(function(){
		$("#updateProduct").click(function(){
			$.post("calcProductComment.do",{productId:"${productId}",hide:"N"},function(data) { hidecallback(data);},"json");
		});
		$('.comment-filter').each(function(){
			$(this).find('li').bind('mouseenter mouseleave', function(){
				$(this).toggleClass('current');
			});
			$(this + ':not("up")').find('a').bind('click', function(){
				$(this).parent('li').addClass('up').siblings('li').removeClass('up');
	  	});
		});
	});
	function hidecallback(data){
		if ( data == "true" ) {
			location.reload();
		}
	}
</script>
<h1>商品管理 - 商品評價<br/>
<div class="f-link">
	<a href="${midContextPath}/product2/list.do">回商品列表页</a>
</div>
</h1>
<br/>
<!-- include product step menu -->
<jsp:include page="../product/commonMenu2.jsp"/>
<p><strong class="txt-L">评分总值：</strong>(不包含未审核/隐藏的纪录)</p>
      <div class="f-r"><input type="button" id="updateProduct" value="更新总评资讯" /></div>
      
           <div class="rating-summary">
       		 <div class="rating-scores">
                	<div class="score-marker">
                    	<div class="score-num">${productComment.avgScore}<em>分</em></div>
                        <div class="s-box star-<fmt:formatNumber value="${productComment.avgScore}" pattern="#0"/>-${star}">
                            <span class="sr1">&nbsp;</span><span class="sr2">&nbsp;</span><span class="sr3">&nbsp;</span><span class="sr4">&nbsp;</span><span class="sr5">&nbsp;</span>
                            <p>${temp} 共有<em>${productComment.totalRecord}</em>次评分</p>
                        </div>
                    </div>
                    <!-- endof .score-marker -->
                	<ul class="score-chart">
                        <li>好评<span>${productComment.goodScore}</span>%<div class="score-bar"><div style="width:${productComment.goodScore}%" class="score-probe"></div></div></li>
                        <li>中评<span>${productComment.midScore}</span>%<div class="score-bar"><div style="width:${productComment.midScore}%" class="score-probe"></div></div></li>
                        <li>差评<span>${productComment.lowScore}</span>%<div class="score-bar"><div style="width:${productComment.lowScore}%" class="score-probe"></div></div></li>
                    </ul>
                    <!-- endof .score-chart -->
                </div>
                <!-- endof .rating-scores -->
                <c-rt:if test="${product.commentSize == 'Y'}">
                <div class="size-survey">
                	<ul>
                        <li>${productComment.bigSize}%<strong>觉得偏大</strong></li>
                        <li>${productComment.midSize}%<strong>觉得适中</strong></li>
                        <li>${productComment.smallSize}%<strong>觉得偏小</strong></li>
                    </ul>
	             </div>
	             </c-rt:if>
             <!-- endof .size-survey -->
           </div>
           <!-- endof .rating-summar -->
           <div class="comment-wall">
           		<ul class="comment-filter">
                	<li class="up"><a href="product.do?product=${productId}">全部评价(${productComment.totalRecord})</a></li>
                    <li class=""><a href="product.do?product=${productId}&commentTp=Good">好评(${productComment.goodRecord})</a></li>
                    <li class=""><a href="product.do?product=${productId}&commentTp=Mid">中评(${productComment.midRecord})</a></li>
                    <li class=""><a href="product.do?product=${productId}&commentTp=Low">差评(${productComment.lowRecord})</a></li>
                </ul>
               		<!-- <p align="center"><img class="comment-loading" src="/images/loading.gif" width="32" height="32" /></p>-->
               		<s:if test="commentProductList.size == 0"><p align="center">暂无评价</p></s:if>
                    <c:forEach items="${commentProductList}" var="comment" varStatus="rows_index">
                    <div class="comment tb-${rows_index.count % 2 == 0 ? 'a' : 'b'}">
                        <div class="comment-title"><strong>${comment.subject}</strong>
                            <div class="s-box star-${comment.score}-0">
                                <span class="sr1">&nbsp;</span><span class="sr2">&nbsp;</span><span class="sr3">&nbsp;</span><span class="sr4">&nbsp;</span><span class="sr5">&nbsp;</span>
                            </div>
                            <span class="comment-date"><fmt:formatDate value="${comment.createDate}" pattern="yyyy-MM-dd HH:mm:ss" /></span>
                            <span class="commentator">评论自：<em>${comment.loginId}</em></span>
                        </div>
                        <p>${comment.content}</p>
                        <p class="comment-info">商品属性：${comment.specName}<span class="prod-shipto">商品送至：${comment.receiverProvince}</span></p>
                    </div></c:forEach>
                    <s:if test="commentProductList.size > 0">
                    <yaodian100:pageutil link="query.do" pagerObj="${commentProductPager}" /></s:if>
						</div>
